package com.cgw.auth.expection;

import org.gavin.core.domain.Status;
import org.gavin.core.exception.BaseException;

/**
 * AuthkException
 *
 * @author grl
 * @date 2024/4/29
 */
public class AuthException extends BaseException {

    public AuthException(String module, Integer code, Object args, String msg) {
        super(module, code, args, msg);
    }

    public static AuthException le(String module, Integer code, Object args, String msg) {
        return new AuthException(module, code, args, msg);
    }

    public static <T extends Status> AuthException le(T status, String module, Object args) {
        return new AuthException(module, status.getCode(), args, status.getMsg());
    }

    public static <T extends Status> AuthException le(T status) {
        return new AuthException(null, status.getCode(), null, status.getMsg());
    }
}